#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_light_clicked()
{
    // 将背景设置为白色
    this->setStyleSheet("background: rgb(240, 240, 240)");
    // 将文本框的背景设置为白色
    ui->plainTextEdit->setStyleSheet("background: white; color: black");
    // 将按钮字体颜色设置为黑色
    ui->pushButton_dark->setStyleSheet("color: black");
    ui->pushButton_light->setStyleSheet("color: black");
}

void Widget::on_pushButton_dark_clicked()
{
    // 将背景设置为黑色
    this->setStyleSheet("background: black");
    // 将文本框的背景设置为白色
    ui->plainTextEdit->setStyleSheet("background: black; color: white");
    // 将按钮字体颜色设置为黑色
    ui->pushButton_dark->setStyleSheet("color: white");
    ui->pushButton_light->setStyleSheet("color: white");
}
